<?php

namespace App\Http\Controllers\Api;

use App\Models\MiniProgramMainTab;
use App\Models\MiniProgramNav;

class CommonController extends Controller
{
    public function indexNav()
    {
        $list = MiniProgramMainTab::with(['jump' => function ($q) {
            return $q->where('is_show', 1);
        }])->where([
            'mini_type' => $this->getMiniType(),
            'is_show'   => 1,
        ])->orderByDesc('sort')->get();

        return $this->_success($list);
    }

    public function miniAppNav()
    {
        $list = MiniProgramNav::where([
            'mini_type' => $this->getMiniType(),
            'is_show'   => 1,
        ])->orderByDesc('sort')->get();

        return $this->_success($list);
    }
}
